#definition of exceptions
errors = { 'NoSecretAccessKey': { 'message': "AWS authorization key hasn't been setup.", 'code': 'AWS.NoSecretAccessKey' },
           'NoAWSAccessKeyId' : { 'message': "AWS authorization id hasn't been setup.", 'code': 'AWS.NoAWSAccessKeyId' },
           'NoAssociateTag' : { 'message': "AWS associate tag hasn't been setup.", 'code': 'AWS.NoAssociateTag' },
           'RequestServiceNotKnown' : { 'message': "AWS authorization key hasn't been setup.", 'code': 'AWS.RequestServiceNotKnown' },
}


# Exception classes generation
modul = globals()
exceptionActions = dict(__str__=lambda self: repr(self.message))
for err in errors:
    modul[ err] = type(err, (Exception,), dict(errors[err].items()+exceptionActions.items()))
